import API from './api';
import { createAction } from '../../../utils/helps';
import mt from './mutations_type';

export default {
  getSignature: createAction('post', API.apiGetSignature),
  getVerificationCode: createAction('post', API.api_getVerificationCode, undefined, 'init'),
  getUserInfo: createAction('post', API.api_getUserInfo, mt.SetUserInfo),
  getAddress: createAction('post', API.api_getAddress),
  signIn: createAction('post', API.api_signIn),
  exchange: createAction('post', API.api_exchange),
  updateMobilePhone: createAction('post', API.api_updateMobilePhone),
  surplusCardCount: createAction('post', API.api_surplusCardCount),
  getAreas: createAction('post', API.api_getAreaList),
  getProvinces: createAction('post', API.api_getProvinceList, mt.SetPovinceList),
  getCities: createAction('post', API.api_getCityList),
  participateActivity: createAction('post', API.api_participateActivity),
  sendCard: createAction('post', API.api_sendCard),
  couponList: createAction('post', API.api_couponList),
  enterLoginPage: createAction('post', API.api_enterLoginPage),
  downLoadApp() {
    const re = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.baosight.carsharing';
    window.location.href = re;
  },
};
